package services

import (
	"fmt"
	"github.com/goravel/framework/facades"
	"github.com/spf13/cast"
	"goravel/packages/socket/servers"
)

// 公共服务
type CommonService struct {
	//Dependent services
}

// 解析通知
func (r *CommonService) Notice(user_id uint, message string) {
	var stage = "P:notice"
	nclient_id := facades.Cache().GetString(fmt.Sprintf("user:%d", user_id)) // 获取缓存
	servers.SendMessage2Client(nclient_id, cast.ToString(user_id), 200, message, &stage)
}
